package org.sean.contactdemo.util;

import java.io.Serializable;

public class ErrorMessage implements Serializable {
	
	private static final long serialVersionUID = -6063273728164467126L;
	
	public static final String WARN = "WARN";
	public static final String INFO = "INFO";
	public static final String ERROR = "ERROR";
	
	private String title = "";
	private String message = "";
	private String type = INFO;

	public ErrorMessage(){
	}
	
	public ErrorMessage(String title){
		this.title = title;
		this.message = title;
		this.type = INFO;
	}
	
	public ErrorMessage(String title, String message){
		this(title);
		setMessage(message);
	}
	
	public ErrorMessage(String title, String message, String type){
		this(title, message);
		setType(type);
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public String getType(){
		return this.type;
	}
	
	public void setType(String type){
		this.type = type;
	}
	
	public String toString(){
		return "[" + this.type + "]-<" + this.title + ">-{" + this.message + "}";
	}
}